package com.ruoyi.project.system.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 用户任务完成状态对象 user_task_completion
 * 
 * @author ruoyi
 * @date 2025-01-27
 */
@Data
public class UserTaskCompletion {

    /** 主键ID */
    private Integer id;

    /** 关联的任务ID */
    @Excel(name = "关联的任务ID")
    private Integer taskId;

    /** 关联的用户ID */
    @Excel(name = "关联的用户ID")
    private Long userId;

    /** 关联的周期ID */
    @Excel(name = "关联的周期ID")
    private Integer cycleId;

    /** 完成状态（进行中、已完成、已逾期） */
    @Excel(name = "完成状态", readConverterExp = "进行中=进行中,已完成=已完成,已逾期=已逾期")
    private String status;

    /** 完成时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date completedAt;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createdAt;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date updatedAt;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("taskId", getTaskId())
                .append("userId", getUserId())
                .append("cycleId", getCycleId())
                .append("status", getStatus())
                .append("completedAt", getCompletedAt())
                .append("createdAt", getCreatedAt())
                .append("updatedAt", getUpdatedAt())
                .toString();
    }
}